// core
import { createApp } from "vue"
import * as echarts from 'echarts'
import 'echarts-gl'
import App from "@/App.vue"
import store from "@/store"
import router from "@/router"
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'
import "@/router/permission"
import JsonViewer from "vue3-json-viewer"
// load

import { loadSvg } from "@/icons"
import { loadPlugins } from "@/plugins"
import { loadDirectives } from "@/directives"
import setupAxios from "./utils/axios"
// css
import "uno.css"
import "normalize.css"
import "element-plus/dist/index.css"
import "element-plus/theme-chalk/dark/css-vars.css"
import "vxe-table-plugin-element/dist/style.css"
import "@/styles/index.scss"
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
import "vue3-json-viewer/dist/index.css";
import 'dayjs/locale/zh-cn'
import dayjs from 'dayjs'
// 初始化多语言
import { setupI18n } from '@/plugins/vueI18n'
dayjs.locale('zh-cn')

const app = createApp(App)

/** 加载插件 */
loadPlugins(app)
/** 加载全局 SVG */
loadSvg(app)
/** 加载自定义指令 */
loadDirectives(app)
app.config.globalProperties.$echarts = echarts;
app.use(store).use(router)
let axiosInstance = setupAxios(router)
app.config.globalProperties.$http = axiosInstance;
app.use(VXETable)
app.use(JsonViewer)
app.use(Antd)
router.isReady().then(async () => {
  app.mount("#app")
  await setupI18n(app)
})
